<?php
	$publicationID = $_POST['publicationID'];
	
	$PF = new PublicationFactory($publicationID);
	
	$publication = $PF->create();
	
	$comments = $publication->getComments();
	
	/*var_dump($_POST);
	var_dump($publication);
	var_dump($comments);*/
?>

<div id="publication_<?php echo $publicationID; ?>_comments" class='publicationComments paginate'>
	<?php foreach ($comments as $_comment){ 
		$_comment = new Comment($_comment->id);
		$_comment->toHTML();
	} ?>
</div>


<script type="text/javascript">
$j(document).ready(function() {
	$j("#publication_<?php echo $publicationID; ?>_comments").simplePageSwitcher({
	    effectFade : true,
	    perPage    : 5
	});

	$j("#publication_<?php echo $publicationID; ?>_comments  .spp-go-last").click();
});
</script>